<!DOCTYPE html>
<html>
	<head>
		<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
		<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport" />
		<meta content="telephone=no" name="format-detection" />
		<meta content="address=no" name="format-detection" />
		<meta name="apple-mobile-web-app-capable" content="no" />
		<link rel="apple-touch-icon-precomposed" href="http://img0.zz91.com/zz91/images/logo.png" />
		<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-precomposed" />
		<meta name="apple-touch-fullscreen" content="YES">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="shortcut icon" href="http://img0.zz91.com/front/favicon.ico" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="/layui/css/layui.css"/>	
		<script type="text/javascript" src="/layui/layui.js"></script>
		<style>
			.mainbox{
				margin: 10px;
			}
		</style>
	</head>
	<body>
		<div class="mainbox">
			<form class="layui-form" action="user_save.html" method="post">
				<div class="layui-form-item">
				    <label class="layui-form-label"><span style="color: red;">*</span>用户级别</label>
				    <div class="layui-input-block">
				      	<select name="utype" lay-filter="utype" lay-verify="required">
				      		<option value="">请选择...</option>
				      		{%ifequal utype "1"%}
							<option value="1">集团管理员</option>
							{%endifequal%}
							<option value="4">分站管理员</option>
							<option value="2">校验员</option>
							<option value="3">财务人员</option>
				      	</select>
				    </div>
			  	</div>
			  	<div class="layui-form-item">
				    <label class="layui-form-label"><span style="color: red;">*</span>分站（分公司）</label>
				    <div class="layui-input-block">
				      	<select name="company_id" lay-verify="required">
				      		<option value="">请选择...</option>
				      		{%for list in company_list%}
							<option value="{{list.id}}">{{list.name}}</option>
							{%endfor%}
				      	</select>
				    </div>
			  	</div>
			  	<div class="layui-form-item">
				    <label class="layui-form-label"><span style="color: red;">*</span>用户名</label>
				    <div class="layui-input-block">
				      	<input type="text" name="username" lay-verify="required" autocomplete="off" placeholder="请输入用户名" class="layui-input">
				    	<a style="color: red;">{{errtext3}}</a>
				    </div>
			  	</div>
			  	
			  	<div class="layui-form-item">
			    	<label class="layui-form-label"><span style="color: red;">*</span>密码</label>
			    	<div class="layui-input-block">
			      		<input type="password" name="pwd" lay-verify="pass" placeholder="请输入密码" autocomplete="off" class="layui-input">
			    	</div>
			  	</div>
			  	
			  	<div class="layui-form-item">
			    	<label class="layui-form-label"><span style="color: red;">*</span>姓名</label>
			    	<div class="layui-input-block">
			      		<input type="text" name="contact" lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
			    	</div>
			  	</div>
			  	
			  	<div class="layui-form-item">
				    <label class="layui-form-label">性别</label>
				    <div class="layui-input-block">
				      	<input type="radio" name="sex" value="男" checked="" title="男">
				      	<input type="radio" name="sex" value="女" title="女">
				    </div>
			  	</div>
			  
				 <div class="layui-form-item">
				    <label class="layui-form-label">手机</label>
				    <div class="layui-input-inline">
				        <input type="tel" name="mobile" autocomplete="off" class="layui-input">
				    	<a style="color: red;">{{errtext4}}</a>
				    </div>
				</div>
			  	
			  	<div class="layui-form-item layui-form-text">
				    <label class="layui-form-label">备注</label>
				    <div class="layui-input-block">
				      <textarea placeholder="请输入内容" class="layui-textarea" name="bz"></textarea>
				    </div>
				</div>
				
				<div class="layui-form-item layui-col">
					<div class="layui-input-block">
					    <button class="layui-btn layui-btn-normal layui-col-xs2" lay-submit="" lay-filter="demo1">保存</button>
					    <button type="reset" class="layui-btn layui-btn-primary layui-col-xs2">清除</button>
					</div>
				</div>
			</form>
		</div>
			
	</body>
	<script>
		layui.use(['form', 'layedit', 'laydate'], function() {
			var form = layui.form,
				layer = layui.layer,
				layedit = layui.layedit
			//自定义验证规则
			form.verify({
				pass: [/(.+){6,12}$/, '密码必须6到12位'],
				content: function(value) {
					layedit.sync(editIndex);
				}
			});
			form.on('select(utype)', function(data){
				data.value
			});

		});
	</script>
</html>
